package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.WithdrawHistoryVO;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2018/10/10 9:10
 * 修改备注：
 * ================================================
 */

public class WithdrawHistoryListHolder extends BaseViewHolder<WithdrawHistoryVO> {

    private TextView tvTitle;
    private TextView tvTime;
    private TextView tvPrice;


    public WithdrawHistoryListHolder(ViewGroup parent) {
        super(parent, R.layout.item_withdraw_history_list);
        tvTitle = $(R.id.tv_title);
        tvTime = $(R.id.tv_time);
        tvPrice = $(R.id.tv_price);

    }

    @Override
    public void setData(WithdrawHistoryVO data) {
        super.setData(data);

        if("0".equals(data.getWithdrawWay())){
            tvTitle.setText(data.getBankName() + "（" + data.getAccountNumber() + "）");
        }else if("1".equals(data.getWithdrawWay())){
            tvTitle.setText("支付宝"  + "（" + data.getAccountNumber() + "）");
        }else if("2".equals(data.getWithdrawWay())){
            tvTitle.setText("微信");
        }



        tvTime.setText(data.getCreateAt());

        tvPrice.setText("￥" + data.getWithdrawMoney());
    }

}
